package com.rp.upload.po;

// Generated 2014-1-8 16:50:37 by Hibernate Tools 3.2.2.GA

import javax.persistence.Entity;
import javax.persistence.Table;

import org.raptor.entity.BaseModel3;

/**
 * 附件表，通过entityName与entityId两个字段来关联其他实体类
 * @author HuangJian
 * 
 */
@Entity
@Table(name="RP_SYSTEM_ATTACHMENTS")
public class Attachment extends BaseModel3 {
	
	private static final long serialVersionUID = -6188835386310335676L;
	
	/**
	 * 文件的原始文件名
	 */
	private String originalName;
	/**
	 * 通过程序生成的文件名
	 */
	private String generateName;
	/**
	 * 文件的相关描述
	 */
	private String description;
	/**
	 * 文件大小
	 */
	private double fileSize;
	/**
	 * 文件类型
	 */
	private String fileType;
	/**
	 * 绝对路径
	 */
	private String absolutePath;
	/**
	 * 相对路径
	 */
	private String relativePath;
	/**
	 * 下载量
	 */
	private Integer downloadCount;
	/**
	 * 附件所属的实体类或所属表的名称
	 */
	private String entityName;
	
	/**
	 * 附件所属的实体类的ID
	 */
	private String entityId;

	public Attachment() {}

	public Attachment(String createDate, String updateDate, String originalName,
			String generateName, String description, double fileSize,
			String fileType, String absolutePath, String relativePath,
			Integer downloadCount, String entityName, String entityId) {
		this.createDate = createDate;
		this.updateDate = updateDate;
		this.originalName = originalName;
		this.generateName = generateName;
		this.description = description;
		this.fileSize = fileSize;
		this.fileType = fileType;
		this.absolutePath = absolutePath;
		this.relativePath = relativePath;
		this.downloadCount = downloadCount;
		this.entityName = entityName;
		this.entityId = entityId;
	}
	
	/**
	 * * 文件的原始文件名
	 */
	public String getOriginalName() {
		return this.originalName;
	}

	public void setOriginalName(String originalName) {
		this.originalName = originalName;
	}

	/**
	 * * 通过程序生成的文件名
	 */
	public String getGenerateName() {
		return this.generateName;
	}

	public void setGenerateName(String generateName) {
		this.generateName = generateName;
	}

	/**
	 * * 文件的相关描述
	 */
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * * 文件大小
	 */
	public double getFileSize() {
		return this.fileSize;
	}

	public void setFileSize(double fileSize) {
		this.fileSize = fileSize;
	}

	/**
	 * * 文件类型
	 */
	public String getFileType() {
		return this.fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	/**
	 * * 绝对路径
	 */
	public String getAbsolutePath() {
		return this.absolutePath;
	}

	public void setAbsolutePath(String absolutePath) {
		this.absolutePath = absolutePath;
	}

	/**
	 * * 相对路径
	 */
	public String getRelativePath() {
		return this.relativePath;
	}

	public void setRelativePath(String relativePath) {
		this.relativePath = relativePath;
	}

	/**
	 * * 下载量
	 */
	public Integer getDownloadCount() {
		return this.downloadCount;
	}

	public void setDownloadCount(Integer downloadCount) {
		this.downloadCount = downloadCount;
	}

	/**
	 * * 附件所属的实体类的名称
	 */
	public String getEntityName() {
		return this.entityName;
	}

	public void setEntityName(String entityName) {
		this.entityName = entityName;
	}

	/**
	 * * 附件所属的实体类的ID
	 */
	public String getEntityId() {
		return this.entityId;
	}

	public void setEntityId(String entityId) {
		this.entityId = entityId;
	}

	/**
	 * toString
	 * 
	 * @return String
	 */
	public String toString() {
		StringBuffer buffer = new StringBuffer();

		buffer.append(getClass().getName()).append("@")
				.append(Integer.toHexString(hashCode())).append(" [");
		buffer.append("id").append("='").append(getId()).append("' ");
		buffer.append("createDate").append("='").append(getCreateDate())
				.append("' ");
		buffer.append("updateDate").append("='").append(getUpdateDate())
				.append("' ");
		buffer.append("originalName").append("='").append(getOriginalName())
				.append("' ");
		buffer.append("generateName").append("='").append(getGenerateName())
				.append("' ");
		buffer.append("fileSize").append("='").append(getFileSize())
				.append("' ");
		buffer.append("fileType").append("='").append(getFileType())
				.append("' ");
		buffer.append("absolutePath").append("='").append(getAbsolutePath())
				.append("' ");
		buffer.append("relativePath").append("='").append(getRelativePath())
				.append("' ");
		buffer.append("downloadCount").append("='").append(getDownloadCount())
				.append("' ");
		buffer.append("entityName").append("='").append(getEntityName())
				.append("' ");
		buffer.append("entityId").append("='").append(getEntityId())
				.append("' ");
		buffer.append("]");

		return buffer.toString();
	}

}
